
			$(document).ready(function(){
				mainLoop();
			});

			function mainLoop()
			{
					scale  = 1;
					length = 1000;
					$("#canvas").empty();
					firstSlitStart = 20;  //nanometers
					firstSlitEnd = 40;	  //nanometers
					
					for (i = 20 * scale; i < length * scale; i = i + scale) {
						if (i > firstSlitStart * scale) {
							randomNum = Math.floor(Math.random() * 20);
							$("#canvas").append("<div class='photon' id='photon" + i + "'></div>")
							$("#photon" + i).css("top", 20 + "px");
							$("#photon" + i).css("left", i + randomNum + "px");
						}
					}					
			}
				
				
			//function display

			

			function startLoop()
			{
				mainLoop();	 
			}


